<template>
    <div>
        <i class="iconfont icon-weibiaoti26" @click="fn"/>
        {{listSwitch}}
    </div>
</template>

<script>
import store from '@/store/index.js'
export default {
    data(){
        return {

        }
    },
    methods:{
        fn(){
            this.$store.commit('switchSidebar',{
                switchs:!this.listSwitch
            })
        }
    },
    computed:{
        listSwitch(){
            return this.$store.state.switchs
        }
    },
    watch:{
        listSwitch:{
            deep:true,
            handler:function(data){
                console.log(data)
                console.log("我改变了")
            }
        }
    }
};
</script>

<style scoped>
.icon-weibiaoti26 {
    font-size: 24px;
    color: #888;
    cursor: pointer;
    margin-top: 18px;
    display: inline-block;
}
</style>
